﻿@{
	ViewBag.Title = T("Change Password");
}
<ul class="path floatContainer">
    <li class="first">@ActionLinkLocalized("Main", "Index", "Home")</li>
</ul>
<h1>@ViewBag.Title</h1>
@Html.ValidationSummary("<h3>" + S("Please check the following errors:") + "</h3>", new Dictionary<string, object>()
{
	{"currentPassword", new Dictionary<ValidationErrorType, string>(){
		{ValidationErrorType.NullOrEmpty, S("You must specify your current password.")}
		,{ValidationErrorType.CompareNotMatch, S("Your current password does not match.")}}},
	{"newPassword", new Dictionary<ValidationErrorType, string>(){
		{ValidationErrorType.NullOrEmpty, S("You must specify a new password of {0} or more characters.", ViewBag.PasswordLength)}
		,{ValidationErrorType.CompareNotMatch, S("The new password and confirmation password do not match.")}}}
}, null)
@using (Html.BeginForm())
{
    <fieldset>
		<legend>@T("Use the form below to change your password")</legend>
		@if(!Session.IsPasswordReset)
		{
			<div class="formItem floatContainer">
				<label for="currentPassword">@T("Current password")</label>
				@Html.Password("currentPassword")
			</div>
		}
		<div class="formItem floatContainer">
            <label for="newPassword">@T("New password")</label>
            @Html.Password("newPassword")
			<span class="note">@T("New passwords are required to be a minimum of {0} characters in length.", ViewBag.PasswordLength)</span>        
        </div>
		<div class="formItem floatContainer">
            <label for="confirmPassword">@T("Confirm new password")</label>
            @Html.Password("confirmPassword")
        </div>
		<div class="formItem buttons">
            <input type="submit" class="button" value="@T("Change Password")" />
        </div>
	</fieldset>	
}